
{extend name='template/base'}{/extend}
{block name='style'}{/block}
{block name='script'}{/block}
{block name='content'}
<link href="__STATIC__/plugins/webuploader/custom/style.css" rel="stylesheet" type="text/css"/>
<div class="wrapper">
    <form class="form-horizontal" id="form" action="{:url('ShopStore/update')}">
        <div class="box-body">
            <div class="form-group">
                <label class="col-sm-3 control-label">店铺名称</label>
                <div class="col-sm-6">
                    <input type="hidden" name="id" value="{$data.id}">
                    <input class="form-control" type="text" name="name" value="{$data.name}"  datatype="*" nullmsg="请填写店铺名称">
                </div>
                <div class="col-sm-3"></div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">联系电话</label>
                <div class="col-sm-6">
                    <input class="form-control" value="{$data.mobile}" type="text" name="mobile"  datatype="*" nullmsg="请填写联系电话">
                </div>
                <div class="col-sm-3"></div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">起送价格</label>
                <div class="col-sm-6">
                    <div class="input-group">
                        <span class="input-group-addon">￥</span>
                        <input name="aps_price" type="number"  step="0.01" value="{$data.aps_price}" class="form-control" style="width: 100px;">
                    </div>
                </div>
                <div class="col-sm-2"></div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">营业时间</label>
                <div class="col-sm-6">
                    <input class="form-control datetimepicker pull-left" style="width: 150px;" value="{$data.bizhours_start}" type="text" name="bizhours_start" id="begindate"  placeholder="开始时间"/>
                    <span class="pull-left" style=" margin: 0px 10px 0 10px;">至</span>
                    <input class="form-control datetimepicker pull-left" style="width: 150px;" value="{$data.bizhours_end}" type="text" name="bizhours_end" id="enddate" placeholder="结束时间"/>
                </div>
                <div class="col-sm-3"></div>
            </div>
            <!--<div class="form-group">-->
                <!--<label  class="col-sm-3 control-label">定位</label>-->
                <!--<div class="col-sm-8">-->
                    <!--<div class="row">-->
                        <!--<div class="col-sm-3">-->
                            <!--<button type="button" id="picker" class="btn btn-primary">&nbsp;&nbsp;选择位置&nbsp;&nbsp;</button>-->
                        <!--</div>-->
                        <!--<div class="col-sm-5">-->
                            <!--<input class="form-control" type="text" id="location" value="{$data.longitude},{$data.latitude}" name="location" readonly="true"  datatype="*" nullmsg="请选择定位">-->
                        <!--</div>-->
                        <!--<div class="col-sm-3"></div>-->
                    <!--</div>-->
                <!--</div>-->
            <!--</div>-->
            <div class="form-group">
                <label class="col-sm-3 control-label">LOGO</label>
                <div class="col-sm-6">
                    <div class="row">
                        <div class="col-sm-6">
                            <input id="logo" name="logo" value="{$data.logo}" type="hidden"/>
                            <button type="button" id="logo_btn" class="btn btn-primary simple-upload">上传图片</button>
                        </div>
                        <div class="col-sm-6">
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">封面图片</label>
                <div class="col-sm-6">
                    <div class="row">
                        <div class="col-sm-6">
                            <input id="cover_image" name="cover_image" value="{$data.cover_image}" type="hidden"/>
                            <button type="button" id="cover_image_btn" class="btn btn-primary simple-upload">上传图片</button>
                        </div>
                        <div class="col-sm-6">
                        </div>
                    </div>
                </div>
            </div>


            <!--<div class="form-group">-->
            <!--<label class="col-sm-3 control-label">省份</label>-->
            <!--<div class="col-sm-6">-->
            <!--<input class="form-control" type="text" name="province">-->
            <!--</div>-->
            <!--<div class="col-sm-3"></div>-->
            <!--</div>-->
            <!--<div class="form-group">-->
            <!--<label class="col-sm-3 control-label">城市</label>-->
            <!--<div class="col-sm-6">-->
            <!--<input class="form-control" type="text" name="city">-->
            <!--</div>-->
            <!--<div class="col-sm-3"></div>-->
            <!--</div>-->
            <!--<div class="form-group">-->
            <!--<label class="col-sm-3 control-label">地区</label>-->
            <!--<div class="col-sm-6">-->
            <!--<input class="form-control" type="text" name="district">-->
            <!--</div>-->
            <!--<div class="col-sm-3"></div>-->
            <!--</div>-->

            <div class="form-group">
                <label class="col-sm-3 control-label">详细地址</label>
                <div class="col-sm-6">
                    <textarea class="form-control" rows="2"  type="text" name="shop_address" maxlength="255">{$data.shop_address}</textarea>
                </div>
                <div class="col-sm-3"></div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">简介</label>
                <div class="col-sm-6">
                    <textarea class="form-control" rows="2" type="text" name="summary" maxlength="255">{$data.summary}</textarea>
                </div>
                <div class="col-sm-3"></div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">是否营业</label>
                <div class="col-sm-6">
                    <span class="mr20" style="padding-right: 20px"><input type="radio" class="minimal" name="flag_lock" value="0" {if $data.flag_lock eq 0}checked{/if}> 正常营业</span>
                    <span class="mr20"><input type="radio" class="minimal" name="flag_lock" value="1" {if $data.flag_lock eq 1}checked{/if}> 停止营业</span>
                </div>
                <div class="col-sm-3"></div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">是否推荐店铺</label>
                <div class="col-sm-6">
                    <span class="mr20" style="padding-right: 20px"><input type="radio" class="minimal" name="is_recommended" value="1" {if $data.is_recommended eq 1}checked{/if}> 是</span>
                    <span class="mr20"><input type="radio" class="minimal" name="is_recommended" value="0" {if $data.is_recommended eq 0}checked{/if}> 否</span>
                </div>
                <div class="col-sm-3"></div>
            </div>
            <!--<input class="form-control" type="hidden" id="longitude"  value="{$data.longitude}" name="longitude">-->
            <!--<input class="form-control" type="hidden" id="latitude"  value="{$data.latitude}" name="latitude">-->
            <!--<input class="form-control" type="hidden" name="zoom">-->
            <div class="form-group">
                <div class="col-sm-9 col-sm-offset-3">
                    <button type="submit" class="btn btn-primary">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                    <button type="button" class="btn btn-default radius ml-20" onclick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
                </div>
            </div>
        </div>
    </form>
</div>
{/block}
{block name='script_extra'}

<script>
    // <editor-fold defaultstate="collapsed" desc="定位">
//    $('#picker').on('click',function () {
//        var url = "{:url('shop_store/position')}";
//
//        layer_open("选择地址",url);
//    });
    // </editor-fold>
    $('.datetimepicker').datetimepicker({
        format: "H:i",
        lang: 'ch',
        timepicker: true,
        datepicker: false
    });
    $('#logo_btn').on('click',function (e) {
        var ids=$("#logo").val();
        //alert("{:url('/addons/web_uploader/upload')}"+"/parent_ele/simple"+"/id/"+ids);
        layer_open('单图上传',"{:url('/addons/web_uploader/upload/parent_ele/logo/id/"+ids+"')}",{w:"600px",h:"400px"})
    });
    $('#cover_image_btn').on('click',function (e) {
        var ids=$("#cover_image").val();
        //alert("{:url('/addons/web_uploader/upload')}"+"/parent_ele/simple"+"/id/"+ids);
        layer_open('单图上传',"{:url('/addons/web_uploader/upload/parent_ele/cover_image/id/"+ids+"')}",{w:"600px",h:"400px"})
    });
    $("#form").Validform({
        tiptype:2,
        showAllError:true,
        ajaxPost: true,
        callback: function (res) {
            if (res.success == true){
                layer.msg(res.message, {time: 1000},function () {
                    layer_close();
                    parent.$('#table').bootstrapTable('refresh');
                });
            }else{
                layer.alert(res.message);
            }
        }
    });
</script>
{/block}